//
//  YYDriverOrderVC.m
//  drivingSchool
//
//  Created by 子yu 刘 on 2018/8/13.
//  Copyright © 2018年 子yu 刘. All rights reserved.
//

#import "YYDriverOrderVC.h"
#import "YYDriverCell.h"

@interface YYDriverOrderVC ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic ,strong)NSArray *dataArr;

@end

@implementation YYDriverOrderVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self getData];
}

-(void)getData{
//    [RequestOperationManager personalOrder_type:@"1" success:^(id result) {
//        if (DEF_REQ_SUCCESS) {
//            self.dataArr = result[@"data"][@"list"];
//            if (self.dataArr.count  == 0) {
//                self.baseLabel.text = @"暂无订单";
//                self.baseImageView.hidden = NO;
//            }else{
//                   [self.tableView reloadData];
//            }
//        }
//        
//    } failture:^(NSError *error) {
//        
//    }];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.dataArr.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    YYDriverCell * cell = [tableView dequeueReusableCellWithIdentifier:@"YYDriverCell"];
    NSDictionary * dict = self.dataArr[indexPath.row];
    cell.lbPrice.text = dict[@"money"];
    [cell.img sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",DEF_INTERFACE_WEBVIEWSERVICE,dict[@"image"]]]];
    cell.lbSchoolName.text = dict[@"school_name"];
    cell.lbSchoolAdress.text = dict[@"school_address"];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 120;
}

- (NSArray *)dataArr{
    if (!_dataArr) {
        _dataArr = [NSArray array];
    }
    return _dataArr;
}

@end
